<template>
  <div class="userchange">
    <a-input placeholder="修改姓名" v-model="form.username" />
    <div class="mt-2">
      <a-radio-group v-model="value" @change="onChange">
        <a-radio :value="1"> 男 </a-radio>
        <a-radio :value="0"> 女 </a-radio>
      </a-radio-group>
    </div>
  </div>
</template>

<script>
export default {
  name: "Userchange",
  data() {
    return {
      value: 1,
      form: {
        username: "",
        gender: "",
      },
    };
  },
  methods: {
    onChange(e) {
      this.form.gender=e.target.value
    },
  },
  watch:{
      form:{
          handler(val){
            console.log(val);
              this.$emit("fromdata",val)
          },
          deep:true
      }
  }
};
</script>

<style></style>
